package com.itany.controller;

import com.itany.constant.StatusConst;
import com.itany.mapper.PressMapper;
import com.itany.pojo.Press;
import com.itany.pojo.PressExample;
import com.itany.vo.ActionResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/press")
public class PressController {
    @Autowired
    PressMapper pressMapper;

    @RequestMapping("/findAll")
    public ActionResult findAll() {
        ActionResult result = new ActionResult();
        PressExample example = new PressExample();
        example.or().andFlagEqualTo(StatusConst.ENABLE);
        List<Press> presses = pressMapper.selectByExample(example);
        result.setData(presses);
        return result;
    }
}
